package com.starlz.jpa.dao;

import com.starlz.jpa.entity.Emp;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.Repository;


import java.util.List;

/**
 * @Description:
 * @Author: wangzi
 * @Date: 2018/11/12 11:15
 */

public interface EmpDao extends Repository<Emp,Integer> {

    /**
     * 查询全部
     * @return
     */
//    @Query("select d,e from Emp e left join Dept d on e.deptno = d.dno")
    @Cacheable(value = "emp")
    List<Emp> findAll(Pageable pageable);


}
